﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddEnlistment.ascx.vb"
    Inherits="WebForm_ManageEnlistment_AddEnlistment" %>
<%@ Register Src="~/WebForm/SearchControl/SearchInternalUserControl.ascx" TagName="SearchInternalUserControl" TagPrefix="My" %>    
<%@ Reference Control="~/WebForm/CommonControl/CalendarTextBox.ascx" %>
<style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
<div align="right">
    <asp:Button ID="btnSave" runat="server" Text="<%$ Resources:Save %>" ValidationGroup="Save" />
</div>
<asp:Panel ID="Panel1" runat="server" GroupingText="<%$ Resources:EnlistmentInfo %>">
    <asp:FormView ID="FormView_EnlistHeader" runat="server" DataKeyNames="EnlistID" DataSourceID="ObjectDataSource1">
        <ItemTemplate>
            <table width="100%">
                <tr>
                    <td colspan="2">
                        <asp:ValidationSummary ID="sum_Save" runat="server" DisplayMode="List" ShowMessageBox="True"
                            ShowSummary="True" ValidationGroup="Save" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblEnlistName" runat="server" Text="<%$ Resources:EnlistName %>"></asp:Label>
                    </td>
                    <td colspan="3" style="margin-left: 40px">
                        <asp:TextBox ID="txtEnlistName" runat="server" Text='<%# Bind("EnlistName") %>' MaxLength="50"
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtEnlistName" runat="server" ControlToValidate="txtEnlistName"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEnlistName %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblWorkType" runat="server" Text="<%$ Resources:WorkType %>"></asp:Label>
                    </td>
                    <td colspan="3" style="margin-left: 40px">
                        <asp:TextBox ID="txtWorkType" runat="server" MaxLength="50" Text='<%# Bind("WorkType") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtWorkType" runat="server" ControlToValidate="txtWorkType"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtWorkType %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblApplyStartDate" runat="server" Text="<%$ Resources:ApplyStartDate %>"></asp:Label>
                    </td>
                    <td>
                        <My:CalendarTextBox ID="txtApplyStartDate" runat="server" Text='<%#Bind("ApplyStartDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtApplyStartDate" runat="server" ControlToValidate="txtApplyStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtApplyStartDate %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtApplyStartDate2" runat="server" ControlToValidate="txtApplyStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtApplyStartDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <%--                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:TextBox ID="txtApplyStartDate" runat="server" MaxLength="10" Text='<%# Bind("ApplyStartDate", "{0:d}") %>' />
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtApplyStartDate" PopupButtonID="ibtnApplyStartDate">
                                </ajaxToolkit:CalendarExtender>
                                <asp:ImageButton runat="Server" ID="ibtnApplyStartDate" ImageUrl="~/images/Calendar_scheduleHS.png" />
                                
                            </ContentTemplate>
                        </asp:UpdatePanel>--%>
                    </td>
                    <td>
                        <asp:Label ID="lblApplyEndDate" runat="server" Text="<%$ Resources:ApplyEndDate %>"></asp:Label>
                    </td>
                    <td>
                        <My:CalendarTextBox ID="txtApplyEndDate" runat="server" Text='<%#Bind("ApplyEndDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtApplyEndDate" runat="server" ControlToValidate="txtApplyEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtApplyEndDate %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtApplyEndDate2" runat="server" ControlToValidate="txtApplyEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtApplyEndDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <asp:CompareValidator ID="chk_txtApplyEndDate3" runat="server" ControlToCompare="txtApplyEndDate"
                            ControlToValidate="txtApplyStartDate" Display="None" ErrorMessage="<%$ Resources:chk_txtApplyEndDate3 %>"
                            Operator="LessThanEqual" Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <%--                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:TextBox ID="txtApplyEndDate" runat="server" MaxLength="10" Text='<%# Bind("ApplyEndDate", "{0:d}") %>' />
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtApplyEndDate" PopupButtonID="ibtnApplyEndDate">
                                </ajaxToolkit:CalendarExtender>
                                    
                                <asp:ImageButton runat="Server" ID="ibtnApplyEndDate" ImageUrl="~/images/Calendar_scheduleHS.png" />    
                            </ContentTemplate>
                        </asp:UpdatePanel>--%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblStartDate0" runat="server" Text="<%$ Resources:StartDate %>"></asp:Label>
                    </td>
                    <td>
                        <My:CalendarTextBox ID="txtStartDate" runat="server" Text='<%#Bind("StartDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtStartDate" runat="server" ControlToValidate="txtStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtStartDate2" runat="server" ControlToValidate="txtStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <%--                        <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:TextBox ID="txtStartDate" runat="server" MaxLength="10" Text='<%# Bind("StartDate", "{0:d}") %>' />
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtStartDate" PopupButtonID="ibtnStartDate">
                                </ajaxToolkit:CalendarExtender>
                                
                                <asp:ImageButton runat="Server" ID="ibtnStartDate" ImageUrl="~/images/Calendar_scheduleHS.png" />    
                            </ContentTemplate>
                        </asp:UpdatePanel>--%>
                    </td>
                    <td>
                        <asp:Label ID="lblEndDate0" runat="server" Text="<%$ Resources:EndDate %>"></asp:Label>
                    </td>
                    <td>
                        <My:CalendarTextBox ID="txtEndDate" runat="server" Text='<%#Bind("EndDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtEndDate" runat="server" ControlToValidate="txtEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtEndDate2" runat="server" ControlToValidate="txtEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <asp:CompareValidator ID="txtEndDate3" runat="server" ControlToCompare="txtEndDate"
                            ControlToValidate="txtStartDate" Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate3 %>"
                            Operator="LessThanEqual" Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                        <%--                        <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:TextBox ID="txtEndDate" runat="server" MaxLength="10" Text='<%# Bind("EndDate", "{0:d}") %>' />
                                <asp:RequiredFieldValidator ID="chk_txtEndDate" runat="server" ControlToValidate="txtEndDate"
                                    Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="chk_txtEndDate2" runat="server" ControlToValidate="txtEndDate"
                                    Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate2 %>" Operator="DataTypeCheck"
                                    Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                                <asp:CompareValidator ID="txtEndDate3" runat="server" ControlToCompare="txtEndDate"
                                    ControlToValidate="txtStartDate" Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate3 %>"
                                    Operator="LessThanEqual" Type="Date" ValidationGroup="Save"></asp:CompareValidator>
                                <ajaxToolkit:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtEndDate" PopupButtonID="ibtnEndDate">
                                </ajaxToolkit:CalendarExtender>
                                
                                <asp:ImageButton runat="Server" ID="ibtnEndDate" ImageUrl="~/images/Calendar_scheduleHS.png" />    
                            </ContentTemplate>
                        </asp:UpdatePanel>--%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblUOrganizationID" runat="server" Text="<%$ Resources:UOrganizationID %>"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlUOrganizationID" runat="server" SelectedValue='<%# Bind("UOrganizationID") %>'
                            OnDataBinding="ddlUOrganizationID_DataBinding">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="chk_ddlUOrganizationID" runat="server" ControlToValidate="ddlUOrganizationID"
                            Display="None" ErrorMessage="<%$ Resources:chk_ddlUOrganizationID %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:Label ID="lblPeopleRequired" runat="server" Text="<%$ Resources:PeopleRequired %>"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtPeopleRequired" runat="server" Text='<%# Bind("PeopleRequired") %>'
                            MaxLength="5" />
                        <asp:RequiredFieldValidator ID="chk_txtPeopleRequired" runat="server" ControlToValidate="txtPeopleRequired"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtPeopleRequired %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="chk_txtPeopleRequired2" runat="server" ControlToValidate="txtPeopleRequired"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtPeopleRequired2 %>" MaximumValue="9999999"
                            MinimumValue="1" Type="Integer" ValidationGroup="Save"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:Location %>"></asp:Label>
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtLocation" runat="server" MaxLength="50" Text='<%# Bind("Location") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtLocation" runat="server" ControlToValidate="txtLocation"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtLocation %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblDescription" runat="server" Text="<%$ Resources:Description %>"></asp:Label>
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtDescription" runat="server" Height="70px" Text='<%# Bind("Description") %>'
                            TextMode="MultiLine" Width="90%" />
                        <asp:RequiredFieldValidator ID="chk_txtDescription" runat="server" ControlToValidate="txtDescription"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtDescription %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblOwner" runat="server" Text="<%$ Resources:Owner %>"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtOwner" runat="server" MaxLength="50" Text='<%# Bind("Owner") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtOwner" runat="server" ControlToValidate="txtOwner"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtOwner %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:Label ID="lblPhoneNumber" runat="server" Text="<%$ Resources:PhoneNumber %>"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtPhoneNumber" runat="server" MaxLength="50" Text='<%# Bind("PhoneNumber") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtPhoneNumber" runat="server" ControlToValidate="txtPhoneNumber"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtPhoneNumber %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:Button ID="btnSelectOwner" runat="server" CommandName="btnSelectOwner" meta:resourcekey="btnSelectOwner" />                    
                    </td>                    
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblFaxNumber" runat="server" Text="<%$ Resources:FaxNumber %>"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtFaxNumber" runat="server" MaxLength="50" Text='<%# Bind("FaxNumber") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtFaxNumber" runat="server" ControlToValidate="txtFaxNumber"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtFaxNumber %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        <asp:Label ID="lblEmail" runat="server" Text="<%$ Resources:Email %>"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server" MaxLength="50" Text='<%# Bind("Email") %>'
                            Width="98%" />
                        <asp:RequiredFieldValidator ID="chk_txtEmail" runat="server" ControlToValidate="txtEmail"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEmail %>" ValidationGroup="Save"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="chk_txtEmail2" runat="server" ErrorMessage="<%$ Resources:chk_txtEmail2 %>"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="Save"
                            ControlToValidate="txtEmail" Display="None"></asp:RegularExpressionValidator>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" InsertMethod="BLL_Insert"
        OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" TypeName="BLL_AddEnlistment"
        UpdateMethod="BLL_Update">
        <UpdateParameters>
            <asp:Parameter Name="EnlistName" Type="String" />
            <asp:Parameter Name="WorkType" Type="String" />
            <asp:Parameter Name="ApplyStartDate" Type="DateTime" />
            <asp:Parameter Name="ApplyEndDate" Type="DateTime" />
            <asp:Parameter Name="StartDate" Type="DateTime" />
            <asp:Parameter Name="EndDate" Type="DateTime" />
            <asp:Parameter Name="UOrganizationID" Type="String" />
            <asp:Parameter Name="PeopleRequired" Type="Int32" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Owner" Type="String" />
            <asp:Parameter Name="PhoneNumber" Type="String" />
            <asp:Parameter Name="FaxNumber" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="original_EnlistID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="EnlistID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="EnlistName" Type="String" />
            <asp:Parameter Name="WorkType" Type="String" />
            <asp:Parameter Name="ApplyStartDate" Type="DateTime" />
            <asp:Parameter Name="ApplyEndDate" Type="DateTime" />
            <asp:Parameter Name="StartDate" Type="DateTime" />
            <asp:Parameter Name="EndDate" Type="DateTime" />
            <asp:Parameter Name="UOrganizationID" Type="String" />
            <asp:Parameter Name="PeopleRequired" Type="Int32" />
            <asp:Parameter Name="Location" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Owner" Type="String" />
            <asp:Parameter Name="PhoneNumber" Type="String" />
            <asp:Parameter Name="FaxNumber" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="CreateBy" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Panel>
<br />
<asp:Panel ID="Panel2" runat="server" GroupingText="<%$ Resources:CourseInfo %>">
    <asp:FormView ID="FormView_EnlistTrainingCourse" runat="server" DataKeyNames="CourseID"
        DataSourceID="ObjectDataSource2" DefaultMode="Insert" Width="100%">
        <ItemTemplate>
        </ItemTemplate>
        <EditItemTemplate>
            <table>
                <tr>
                    <td width="14%">
                        <asp:Label ID="lblCourseName" runat="server" Text="<%$ Resources:CourseName %>"></asp:Label>
                    </td>
                    <td colspan="4" align="left">
                        <asp:TextBox ID="txtCourseName" runat="server" Text='<%# Bind("CourseName") %>' MaxLength="50"
                            Width="99%" />
                        <asp:RequiredFieldValidator ID="chk_txtCourseName" runat="server" ControlToValidate="txtCourseName"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtCourseName %>" ValidationGroup="InsertCourse"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTrainingHour" runat="server" Text="<%$ Resources:TrainingHour %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtTrainingHour" runat="server" Text='<%# Bind("TrainingHour") %>'
                            MaxLength="5" />
                        <asp:RequiredFieldValidator ID="chk_txtTrainingHour" runat="server" ControlToValidate="txtTrainingHour"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtTrainingHour %>" ValidationGroup="InsertCourse"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="chk_txtTrainingHour2" runat="server" ControlToValidate="txtTrainingHour"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtTrainingHour2 %>" MaximumValue="9999999"
                            MinimumValue="1" Type="Integer" ValidationGroup="InsertCourse"></asp:RangeValidator>
                    </td>
                    <td width="14%">
                        <asp:Label ID="lblCourseType" runat="server" Text="<%$ Resources:CourseType %>"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlCourseType" runat="server" DataSourceID="SqlDataSource1"
                            DataTextField="theText" DataValueField="theValue" SelectedValue='<%# Bind("CourseType") %>'
                            OnDataBound="ddlCourseType_DataBound">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                            SelectCommand="select [Text] as theText,[Value] as theValue 
from CodeMapping 
where TableName='CleanPlan' and ColumnName='ItemType' and Active='Y'
order by Sequence"></asp:SqlDataSource>
                        <asp:RequiredFieldValidator ID="chk_ddlCourseType" runat="server" ControlToValidate="ddlCourseType"
                            Display="None" ErrorMessage="<%$ Resources:chk_ddlCourseType %>" ValidationGroup="InsertCourse"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblStartDate" runat="server" Text="<%$ Resources:StartDate %>"></asp:Label>
                    </td>
                    <td align="left">
                        <My:CalendarTextBox ID="txtCourseStartDate" runat="server" Text='<%#Bind("StartDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtCourseStartDate" runat="server" ControlToValidate="txtCourseStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate %>" ValidationGroup="InsertCourse"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtCourseStartDate2" runat="server" ControlToValidate="txtCourseStartDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="InsertCourse"></asp:CompareValidator>
                    </td>
                    <td>
                        <asp:Label ID="lblEndDate" runat="server" Text="<%$ Resources:EndDate %>"></asp:Label>
                    </td>
                    <td align="left">
                        <My:CalendarTextBox ID="txtCourseEndDate" runat="server" Text='<%#Bind("EndDate") %>' />
                        <asp:RequiredFieldValidator ID="chk_txtCourseEndDate" runat="server" ControlToValidate="txtCourseEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate %>" ValidationGroup="InsertCourse"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="chk_txtCourseEndDate2" runat="server" ControlToValidate="txtCourseEndDate"
                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate2 %>" Operator="DataTypeCheck"
                            Type="Date" ValidationGroup="InsertCourse"></asp:CompareValidator>
                        <asp:CompareValidator ID="chk_txtCourseEndDate3" runat="server" ControlToCompare="txtCourseEndDate"
                            ControlToValidate="txtCourseStartDate" Display="None" ErrorMessage="<%$ Resources:chk_txtCourseEndDate3 %>"
                            Operator="LessThanEqual" Type="Date" ValidationGroup="InsertCourse"></asp:CompareValidator>
                    </td>
                    <td align="right">
                        <asp:LinkButton ID="lbtnAddCourse" runat="server" Text="<%$ Resources:AddCourse %>"
                            ValidationGroup="InsertCourse" CommandName="Insert" Width="80px"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
    </asp:FormView>
    <asp:ValidationSummary ID="sum_InsertCourse" runat="server" DisplayMode="List" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="InsertCourse" />
    <My:MyGridView ID="GridView_EnlistTrainingCourse" runat="server" AllowHoverEffect="False"
        AllowHoverSelect="False" AutoGenerateColumns="False" DataKeyNames="CourseID"
        DataSourceID="ObjectDataSource2" MouseOverColor="Yellow" MySortDirection="Ascending"
        SkinID="pager" AllowPaging="True" AllowSorting="True" meta:resourcekey="GridView_EnlistTrainingCourse">
        <Columns>
            <asp:TemplateField HeaderText="<%$ Resources:CourseName %>" SortExpression="CourseName">
                <itemtemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("CourseName") %>'></asp:Label>
                </itemtemplate>
                <edititemtemplate>
                    <asp:TextBox ID="txtCourseName" runat="server" Text='<%# Bind("CourseName") %>' MaxLength="50"
                        Width="95%"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtCourseName" runat="server" ControlToValidate="txtCourseName"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtCourseName %>" ValidationGroup="EditCourse"></asp:RequiredFieldValidator>
                </edititemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:TrainingHour %>" SortExpression="TrainingHour">
                <itemtemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("TrainingHour") %>'></asp:Label>
                </itemtemplate>
                <edititemtemplate>
                    <asp:TextBox ID="txtTrainingHour" runat="server" Text='<%# Bind("TrainingHour") %>'
                        MaxLength="5" Width="95%"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="chk_txtTrainingHour" runat="server" ControlToValidate="txtTrainingHour"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtTrainingHour %>" ValidationGroup="EditCourse"></asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="chk_txtTrainingHour2" runat="server" ControlToValidate="txtTrainingHour"
                        Display="None" ErrorMessage="<%$ Resources:chk_txtTrainingHour2 %>" MaximumValue="9999999"
                        MinimumValue="1" Type="Integer" ValidationGroup="EditCourse"></asp:RangeValidator>
                </edititemtemplate>
                <itemstyle width="10%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:CourseTypeName %>" SortExpression="CourseTypeName">
                <itemtemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("CourseTypeName") %>'></asp:Label>
                </itemtemplate>
                <edititemtemplate>
                    <asp:DropDownList ID="ddlCourseType" runat="server" DataSourceID="SqlDataSource1"
                        DataTextField="theText" DataValueField="theValue" OnDataBound="ddlCourseType_DataBound"
                        SelectedValue='<%# Bind("CourseType") %>'>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                        SelectCommand="select [Text] as theText,[Value] as theValue 
from CodeMapping 
where TableName='CleanPlan' and ColumnName='ItemType' and Active='Y' 
order by Sequence"></asp:SqlDataSource>
                    <asp:RequiredFieldValidator ID="chk_ddlCourseType" runat="server" ControlToValidate="ddlCourseType"
                        Display="None" ErrorMessage="<%$ Resources:chk_ddlCourseType %>" ValidationGroup="EditCourse"></asp:RequiredFieldValidator>
                </edititemtemplate>
                <itemstyle width="15%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:StartEndDate %>" SortExpression="StartDate">
                <itemtemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("StartDate", "{0:d}") %>'></asp:Label>
                    ~<asp:Label ID="Label5" runat="server" Text='<%# Bind("EndDate", "{0:d}") %>'></asp:Label>
                </itemtemplate>
                <edititemtemplate>
                    <table>
                        <tr>
                            <td>
                    <My:CalendarTextBox ID="txtCourseStartDate_Edit" runat="server" Text='<%#Bind("StartDate") %>' />
                                        <asp:RequiredFieldValidator ID="chk_txtCourseStartDate_Edit" runat="server" ControlToValidate="txtCourseStartDate_Edit"
                                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate %>" ValidationGroup="EditCourse"></asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="chk_txtCourseStartDate_Edit2" runat="server" ControlToValidate="txtCourseStartDate_Edit"
                                            Display="None" ErrorMessage="<%$ Resources:chk_txtStartDate2 %>" Operator="DataTypeCheck"
                                            Type="Date" ValidationGroup="EditCourse"></asp:CompareValidator>
                                                            
<%--                                <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtCourseStartDate_Edit" runat="server" Text='<%# Bind("StartDate", "{0:d}") %>'
                                            Width="95%"></asp:TextBox>
                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender7" runat="server" TargetControlID="txtCourseStartDate_Edit">
                                        </ajaxToolkit:CalendarExtender>
                                    </ContentTemplate>
                                </asp:UpdatePanel>--%>
                            </td>
                       </tr>
                       <tr>     
                            <td>
                            <My:CalendarTextBox ID="txtCourseEndDate_Edit" runat="server" Text='<%#Bind("EndDate") %>' />
                                        <asp:RequiredFieldValidator ID="chk_txtCourseEndDate_Edit" runat="server" ControlToValidate="txtCourseEndDate_Edit"
                                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate %>" ValidationGroup="EditCourse"></asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="chk_txtCourseEndDate_Edit2" runat="server" ControlToValidate="txtCourseEndDate_Edit"
                                            Display="None" ErrorMessage="<%$ Resources:chk_txtEndDate2 %>" Operator="DataTypeCheck"
                                            Type="Date" ValidationGroup="EditCourse"></asp:CompareValidator>
                                        <asp:CompareValidator ID="chk_txtCourseEndDate_Edit3" runat="server" ControlToCompare="txtCourseEndDate_Edit"
                                            ControlToValidate="txtCourseStartDate_Edit" Display="None" ErrorMessage="<%$ Resources:chk_txtCourseEndDate_Edit3 %>"
                                            Operator="LessThanEqual" Type="Date" ValidationGroup="EditCourse"></asp:CompareValidator>
                            
<%--                                <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtCourseEndDate_Edit" runat="server" Text='<%# Bind("EndDate", "{0:d}") %>'
                                            Width="95%"></asp:TextBox>
                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender8" runat="server" TargetControlID="txtCourseEndDate_Edit">
                                        </ajaxToolkit:CalendarExtender>
                                    </ContentTemplate>
                                </asp:UpdatePanel>--%>
                            </td>
                        </tr>
                    </table>
                </edititemtemplate>
                <itemstyle width="26%" />
            </asp:TemplateField>
            <asp:TemplateField>
                <itemtemplate>
                    <asp:LinkButton ID="lbtnCheck" runat="server" OnClick="lbtnCheck_Click" Text="<%$ Resources:Check %>"></asp:LinkButton>
                </itemtemplate>
                <itemstyle horizontalalign="Center" />
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <itemtemplate>
                    <asp:LinkButton ID="lbtnEdit" runat="server" Text="<%$ Resources:Edit %>" CausesValidation="False"
                        CommandName="Edit"></asp:LinkButton>
                </itemtemplate>
                <edititemtemplate>
                    <asp:LinkButton ID="lbtnUpdate" runat="server" CommandName="Update" Text="<%$ Resources:Update %>"
                        ValidationGroup="EditCourse"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="lbtnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="<%$ Resources:Cancel %>"></asp:LinkButton>
                </edititemtemplate>
                <itemstyle horizontalalign="Center" width="80px" wrap="false" />
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <itemtemplate>
                    <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                        OnClientClick="<%$ Resources:DeleteConfirm %>" Text="<%$ Resources:Delete %>"></asp:LinkButton>
                </itemtemplate>
                <itemstyle horizontalalign="Center" width="40px" wrap="false" />
            </asp:TemplateField>
        </Columns>
    </My:MyGridView>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DeleteMethod="BLL_Delete"
        InsertMethod="BLL_Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select"
        TypeName="BLL_AddEnlistment_Course" UpdateMethod="BLL_Update">
        <DeleteParameters>
            <asp:Parameter Name="original_CourseID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="CourseName" Type="String" />
            <asp:Parameter Name="TrainingHour" Type="Int32" />
            <asp:Parameter Name="CourseType" Type="String" />
            <asp:Parameter Name="StartDate" Type="DateTime" />
            <asp:Parameter Name="EndDate" Type="DateTime" />
            <asp:Parameter Name="UpdateBy" Type="String" />
            <asp:Parameter Name="original_CourseID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="EnlistID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="EnlistID" Type="Int32" />
            <asp:Parameter Name="CourseName" Type="String" />
            <asp:Parameter Name="TrainingHour" Type="Int32" />
            <asp:Parameter Name="CourseType" Type="String" />
            <asp:Parameter Name="StartDate" Type="DateTime" />
            <asp:Parameter Name="EndDate" Type="DateTime" />
            <asp:Parameter Name="CreateBy" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:ValidationSummary ID="sum_EditCourse" runat="server" DisplayMode="List" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="EditCourse" />
</asp:Panel>
<br />
<asp:Panel ID="Panel3" runat="server" GroupingText="<%$ Resources:VolunteerList %>">
    <My:MyGridView ID="GV" runat="server" AllowHoverEffect="False" AllowHoverSelect="False"
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="VolunteerID"
        MouseOverColor="Yellow" MySortDirection="Ascending" SkinID="pager" meta:resourcekey="gv">
        <Columns>
            <asp:BoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
                ReadOnly="True" SortExpression="VolunteerID" />
            <asp:BoundField DataField="VolunteerName" HeaderText="<%$ Resources:VolunteerName %>"
                ReadOnly="True" SortExpression="VolunteerName" />
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" meta:resourcekey="bfTrainingBHour">
                <itemtemplate>
                    <%#Eval("TrainingBHour")%>
                </itemtemplate>
                <itemstyle horizontalalign="Center" />
            </asp:TemplateField>
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" meta:resourcekey="bfTrainingSHour">
                <itemtemplate>
                    <%#Eval("TrainingSHour")%>
                </itemtemplate>
                <itemstyle horizontalalign="Center" />
            </asp:TemplateField>
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" meta:resourcekey="bfTrainingWHour">
                <itemtemplate>
                    <%#Eval("TrainingWHour")%>
                </itemtemplate>
                <itemstyle horizontalalign="Center" />
            </asp:TemplateField>
        </Columns>
    </My:MyGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
        SelectCommand="SELECT B.VolunteerID,B.VolunteerName,vs.TrainingBHour,vs.TrainingSHour,vs.TrainingWHour 
FROM EnlistRecord A
inner join Volunteer B on A.VolunteerID=B.VolunteerID
inner join VolunteerStat vs on B.VolunteerID=vs.VolunteerID
WHERE EnlistID=@EnlistID">
        <SelectParameters>
            <asp:Parameter Name="EnlistID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Panel>

<My:SearchInternalUserControl ID="SearchInternalUserControl1" runat="server" />